package com.cold.manage.service.impl;

import java.util.List;
import com.cold.common.utils.DateUtils;
import com.cold.manage.service.IAlertMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cold.manage.mapper.AlertMessageMapper;
import com.cold.common.domain.AlertMessage;

/**
 * 报警消息Service业务层处理
 * 
 * @author cold
 * @date 2024-02-29
 */
@Service
public class AlertMessageServiceImpl implements IAlertMessageService
{
    @Autowired
    private AlertMessageMapper alertMessageMapper;

    /**
     * 查询报警消息
     * 
     * @param id 报警消息主键
     * @return 报警消息
     */
    @Override
    public AlertMessage selectAlertMessageById(Long id)
    {
        return alertMessageMapper.selectAlertMessageById(id);
    }

    /**
     * 查询报警消息列表
     * 
     * @param alertMessage 报警消息
     * @return 报警消息
     */
    @Override
    public List<AlertMessage> selectAlertMessageList(AlertMessage alertMessage)
    {
        return alertMessageMapper.selectAlertMessageList(alertMessage);
    }

    /**
     * 新增报警消息
     * 
     * @param alertMessage 报警消息
     * @return 结果
     */
    @Override
    public int insertAlertMessage(AlertMessage alertMessage)
    {
        alertMessage.setCreateTime(DateUtils.getNowDate());
        return alertMessageMapper.insertAlertMessage(alertMessage);
    }

    /**
     * 修改报警消息
     * 
     * @param alertMessage 报警消息
     * @return 结果
     */
    @Override
    public int updateAlertMessage(AlertMessage alertMessage)
    {
        return alertMessageMapper.updateAlertMessage(alertMessage);
    }

    /**
     * 批量删除报警消息
     * 
     * @param ids 需要删除的报警消息主键
     * @return 结果
     */
    @Override
    public int deleteAlertMessageByIds(Long[] ids)
    {
        return alertMessageMapper.deleteAlertMessageByIds(ids);
    }

    /**
     * 删除报警消息信息
     * 
     * @param id 报警消息主键
     * @return 结果
     */
    @Override
    public int deleteAlertMessageById(Long id)
    {
        return alertMessageMapper.deleteAlertMessageById(id);
    }
}
